<%--
  Created by IntelliJ IDEA.
  User: 29276
  Date: 2021/8/22
  Time: 10:55
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    //http://localhost:8080/01_sxtoa_war_exploded/
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <base href="<%=basePath%>"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <link href="css/select.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.idTabs.min.js"></script>
    <script type="text/javascript" src="js/select-ui.min.js"></script>
    <script type="text/javascript" src="editor/kindeditor.js"></script>
    <script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        $(document).ready(function(e) {
            $(".select1").uedSelect({
                width : 345
            });

        });
    </script>
    <script type="text/javascript">
        KE.show({id:"ecp",width:"800px",height:"300px"});
    </script>

    <script type="text/javascript">
        $(function () {
            $.post("deptServlet", {methodName:"deptList"}, function (data) {
                if (data === "sessionTimeOut") {
                    window.location.href="login.jsp";
                    return;
                }
                eval("var ds="+data);
                var deptSelect = $("#deptSelect");
                for (var i = 0; i < ds.length; i++) {
                    deptSelect.append("<option value='"+ds[i].deptNo+"'>"+ds[i].deptName+"</option>");
                }
            })
        })
    </script>


    <script type="text/javascript">
        $(function () {
            $.post("posServlet", {methodName:"posList"}, function (data) {
                if (data === "sessionTimeOut") {
                    window.location.href="login.jsp";
                    return;
                }
                eval("var ds="+data);
                var posSelect = $("#posSelect");
                for (var i = 0; i < ds.length; i++) {
                    posSelect.append("<option value='"+ds[i].posId+"'>"+ds[i].posName+"</option>");
                }
            })
        })
    </script>

    <script type="text/javascript">
        $(function () {
            $.post("empServlet", {emptyPe:2, methodName:"empLeader"}, function (data) {
                if (data === "sessionTimeOut") {
                    window.location.href="login.jsp";
                    return;
                }
                eval("var ds="+data);
                var leaderSelect = $("#leaderSelect");
                for (var i = 0; i < ds.length; i++) {
                    leaderSelect.append("<option value='"+ds[i].empId+"'>"+ds[i].realName+"</option>");
                }
            })
        })
    </script>

    <script type="text/javascript">
        $(function () {
            $("#submit").click(function () {
                var reqData = $("#empFm").serialize();
                console.log(reqData);
                $.post("empServlet", reqData, function (data) {
                    if (data === "sessionTimeOut") {
                        window.location.href="login.jsp";
                        return;
                    }
                    if (eval(data)) {
                        alert("修改成功！");
                        window.location.assign("personManager/empList.jsp");
                    } else {
                        alert("修改失败！");
                    }
                })
            })

        })
    </script>
</head>

<body>

<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">人事管理</a></li>
        <li><a href="#">修改信息</a></li>
    </ul>
</div>

<div class="formbody">

    <div class="formtitle"><span>基本信息</span></div>
    <form id="empFm" action="">
        <ul class="forminfo">

            <input name="methodName" type="hidden" value="empConfirmUpdate"/>
            <li>
                <label>用户名</label>
                <input name="empId" readonly type="text" class="dfinput" value="${requestScope.emp.empId}" />
            <li>
            <li>
                <label>真实姓名</label>
                <input name="realName" type="text" class="dfinput" value="${requestScope.emp.realName}" /><i></i></li>
            <li>
                <label>出生日期</label>
                <input name="birthdate" type="text" class="dfinput" value="${requestScope.emp.birthdate}" onfocus="WdatePicker({skin:'whyGreen',lang:'en'})" /><i></i></li>
            <li>
            <li>
                <label>入职时间</label>
                <input name="hireDate" type="text" class="dfinput" value="${requestScope.emp.hireDate}" onfocus="WdatePicker()"/><i></i></li>

            <li>
                <label>离职时间</label>
                <input name="leaveDate" type="text" class="dfinput" value="${requestScope.emp.leaveDate}" onfocus="WdatePicker()"/><i></i></li>

            <li>
                <label>所属部门<b>*</b></label>
                <div class="vocation">
                    <select id="deptSelect" name="deptNo" class="select1">
                        <option value="${requestScope.emp.deptNo}">请选择</option>
                    </select>
                </div>

            </li>
            <li>
                <label>从事岗位<b>*</b></label>
                <div class="vocation">
                    <select id="posSelect" name="posId" class="select1">
                        <option value="${requestScope.emp.posId}">请选择</option>
                    </select>
                </div>

            </li>
            <li>
                <label>直接上级<b>*</b></label>
                <div class="vocation">
                    <select id="leaderSelect" name="mgrId" class="select1">
                        <option value="${requestScope.emp.mgrId}">请选择</option>
                    </select>
                </div>
            </li>
            <li>
                <label>联系方式</label>
                <input name="phone" type="text" class="dfinput" value="${requestScope.emp.phone}" />
            </li>
            <li>
                <label>QQ号</label>
                <input name="qq" type="text" class="dfinput" value="${requestScope.emp.qq}" />
            </li>
<%--            <li>--%>
<%--                <label>紧急联系人信息</label>--%>
<%--                <textarea name="emercontactPerson" cols="" rows="" id="ecp" class="textinput"></textarea>--%>
<%--            </li>--%>
            <li>
                <label>身份证号</label>
                <input name="idCard" type="text" class="dfinput" value="${requestScope.emp.idCard}" />
            </li>

            <li>
                <label>&nbsp;</label>
                <input id="submit" type="button" class="btn" value="确认修改" />
            </li>
        </ul>
    </form>
</div>

</body>

</html>
